package com.itheima.thread04;

//桌子
public class Desk {
    //锁对象
    private  final Object lock = new Object();

    //标记
    private  boolean flag;

    //数量
    private  int count;

    public Desk(boolean flag, int count) {
        this.flag = flag;
        this.count = count;
    }

    public Desk() {
        this(false,10);
    }

    public Object getLock() {
        return lock;
    }

    public boolean isFlag() {
        return flag;
    }

    public void setFlag(boolean flag) {
        this.flag = flag;
    }

    public int getCount() {
        return count;
    }

    public void setCount(int count) {
        this.count = count;
    }

    @Override
    public String toString() {
        return "Desk{" +
                "lock=" + lock +
                ", flag=" + flag +
                ", count=" + count +
                '}';
    }
}
